<?php
/* 图表需要4个变量
 * $chartTitle ： 标题
 * $Y_axis ： Y轴标题
 * $X_axis ：X轴标题
 * $chartData ： 图表数据
 */

$todayBegin = strtotime(date('Y-m-d', time()) . ' 00:00:00');
?>
<link rel="stylesheet" type="text/css"
      href="<?php echo Yii::app()->request->baseUrl; ?>/css/bootstrap-datetimepicker.min.css" />
<script  type="text/javascript"
         src="<?php echo Yii::app()->request->baseUrl; ?>/js/bootstrap-datetimepicker.min.js"/>
<script type="text/javascript">
    $(document).ready(function() {
        $(function() {
            $('#beginTime').datetimepicker({
                language: 'pt-BR'
            });
            $('#endTime').datetimepicker({
                language: 'pt-BR'
            });
        });
        $("#activity_checkAll").click(function() {
            if ($(this).attr("checked") == "checked") {
                $(":checkbox").attr("checked", true);
            } else {
                $(":checkbox").attr("checked", false);
            }
        });
    });
</script> 
<legend>
    <h4>
        <?php
        echo $control->getAjaxLink(array('name' => '功能列表', 'id' => 'showEventList'), array(
            'cooker' => 'BAEvent@showEventList'
        ));
        ?>\
        <?php
        echo $control->getAjaxLink(array('name' => '买单类型', 'id' => 'showBillTypeList'), array(
            'cooker' => 'BAWeBillCooker@showBillTypeList'
        ));
        ?>\
        <?php
        echo $control->getAjaxLink(array('name' => '买单管理', 'id' => 'showManageBill'), array(
            'cooker' => 'BCafeBill@showManageBill'
        ));
        ?>\
        <?php
        echo '交易分析';
        ?>
    </h4>
</legend>

<?php
$form = $this->beginWidget('CActiveForm', array(
    "id" => "billAnalysis",
    'enableAjaxValidation' => FALSE,
    'htmlOptions' => array('enctype' => 'multipart/form-data', 'class' => 'form-inline'),
        ));
?>
<div class="tabbable tabs-right" style="margin-top: 15px;"> <!-- Only required for left/right tabs -->
    <ul class="nav nav-tabs" style="margin-bottom: 15px">
        <li class="active"><a href="#tab1" data-toggle="tab"><?php echo '营业额趋势'; ?></a></li>
        <li class=""><a href="#tab2" data-toggle="tab"><?php echo '客户回访趋势'; ?></a></li>
    </ul>
    <div class="tab-content">
        <div class="tab-pane active" id="tab1" style="min-height: 180px">                
            <?php
            $control2 = new BUIEventControl('showBillTotalAnalyse');
            //$control2->addRenderView('billTotalAnalyse', 'bill_analyse_totalBill');
            $billCooker = new BCafeBillCooker();
            $billCooker->onShowBillAnalyseTotalBill($control2);
            ?>
        </div>
        <div class="tab-pane" id="tab2" style="min-height: 180px">   
            <?php
            $control3 = new BUIEventControl('showBillIntervalFrequency');
            $billCooker->onShowBillAnalyseIntervalFrequency($control3);
            //$control3->addRenderView('billIntervalFrequencyAnalyse', 'bill_analyse_intervalFrequency');
            ?>
            <?php //$control->renderView('bill_analyse_intervaFrequencyl_1', array('analyseIntervaFrequencyl' => $analyseIntervaFrequencyl, 'control' => $control2));  ?>
        </div>
    </div>
</div>
<?php $this->endWidget(); ?>
